<!-- requires 'challenge_signup' local -->
<% if challenge_signup.collection.challenge.signup_open || (!challenge_signup.collection.challenge.signup_open && challenge_signup.collection.user_is_owner?(current_user)) %>
  <ul class="navigation" role="navigation">
    <!-- The edit link should show up only for the user who actually signed up while signups are open or for the owner once signups are closed -->
    <% if (challenge_signup.collection.challenge.signup_open && challenge_signup.pseud.user == current_user) || (!challenge_signup.collection.challenge.signup_open && challenge_signup.collection.user_is_owner?(current_user))  %>
      <li>
        <% unless challenge_signup.collection.potential_matches.count == 0 %>
          <%= link_to('Edit', edit_collection_signup_path(challenge_signup.collection, challenge_signup), 
                  :confirm => t("challenge_signups.potentials_already", 
                  :default => "Note: potential matches will need to be regenerated after your edits.")) %>
        <% else %>
          <%= link_to('Edit', edit_collection_signup_path(challenge_signup.collection, challenge_signup)) %>
        <% end %>
      </li>
    <% end %>
    <li>
      <% unless challenge_signup.collection.potential_matches.count == 0 %>
        <%= link_to t('.challenge_signup.delete_signup', :default => "Delete"), 
          collection_signup_path(challenge_signup.collection, challenge_signup), 
          :confirm => t('.challenge_signup.confirm_delete_signup', :default => "Are you sure? Potential matches will need to be regenerated afterwards."), 
          :method => :delete %>
      <% else %>
        <%= link_to t('.challenge_signup.delete_signup', :default => "Delete"), 
          collection_signup_path(challenge_signup.collection, challenge_signup), 
          :confirm => t('.challenge_signup.confirm_delete_signup', :default => "Are you sure? All information will be lost."), 
          :method => :delete %>
      <% end %>
    </li>
  </ul>
<% end %>